<extend name="Public/user"/>
<block name="link">
	<title>收货地址</title>
	<link href="/static/lida/css/tran_style.css" rel="stylesheet" type="text/css" />
	<link href="__CSS__/bootstrap.min.css" rel="stylesheet"/>
	<script src="__JS__/jquery.js"></script>
	<script src="__JS__/bootstrap.js"></script>
	<link href="__CSS__/shdz-style.css" rel="stylesheet"/>
	<link rel="stylesheet" type="text/css" href="__CSS__/common.css">

</block>
<block name="user-right">
	<style type="text/css">
		.address-form{
			position: absolute;
			width: 270px;
			padding: 20px;
			border: 1px solid red;
			top: -1px;
			left: -1px;
			background: #fff;
			min-height: 160px;
			display: none;
			z-index: 1000;
		}
		form{
			margin: 0;
			padding: 0;
			border: none;
			list-style-type: none;

		}
		.user-right .user-address .address-form input[type="text"]{
			width: 96%;
			padding: 2%;
			border: 1px solid #dfdfdf;
		}
		.blank{height: 10px;clear: both;}
		.btnqx{background: #fafafa;border: 1px solid #dfdfdf;width: 48%;padding: 5px 0;float: left;cursor: pointer;text-align: center;}
		.btnqd{background: #fafafa;border: 1px solid red;width: 48%;padding: 5px 0;float: right;background: red;color:#fff;cursor: pointer;text-align: center;}
	</style>

	<!--main_right-->
	<div class="main_r f_fr" style="height:100%;border:1px solid #ddd;">
		<div class="user_kx">
			<h3 class="user_kx_title" >
				支付宝充值

			</h3>
			<table class="table table-striped table-bordered">

				<tbody>
				<tr>
					<td colspan="6" style="height:150px;background: #ffffff;" >
						<form name=alipayment action="{:url('User/alipay')}" method=post target="_blank">
							<div style="padding:20px;line-height: 25px;">
								<div style="float:left;">
									<label>{:lang('recharge_amount')}：<input type="text" id="chongzhiamount" name="WIDtotal_fee" onkeyup="fillNumOnly(this)"  value="1" style="width:100px;padding:2px;"> {:config('MAIN_COIN')} </label> <br>
									</span>
								</div>



<!--
								<button type="button" target="_blank" style="padding: 5px 15px;border: none;background:red;color:#fff;cursor: pointer;display:inline-block;margin-top: 50px;margin-left:100px;float:left;">去支付宝支付</button>
-->
						</form>


					</td>
				</tr>
				</tbody>


			</table>
		</div>
		<div class="user_kx" >
			<h3 class="user_kx_title">
				{:lang('bank_list')}

			</h3>
			<ul class="user-address" style="border:1px solid #ddd;height:300px;">
				<li class="newadd" style="cursor: pointer;">
					<span style="display:block;border-bottom: 1px solid #dfdfdf;padding-bottom:5px; ">淘宝交易充值(支持信用卡)</span>
					<div style="line-height: 25px;padding: 10px 0;">充值链接：<a href="https://item.taobao.com/item.htm?id=542990157666" target='_blank'><font color='red'>点击这里</font></a> </div>
					<br><br><br><div style="text-align: center">
<!--
					<a href="javascript:;" class="">填充值单</a>&lt;!&ndash;<a href="javascript:;" class="user-btn address-edit">填充值单</a>&ndash;&gt;</div>
-->
					<div class="address-form">
						<form class="chongzform" method="post" action="{:url('')}">
							<input type="text" name="zhname" value=""  placeholder="订单号码">
							<div class="blank"></div>
							<input type="text" name="zhanghao" value="" placeholder="淘宝ID">
							<div class="blank"></div>
							<input type="text" name="amount" value="" placeholder="充值金额(人民币)">
							<div class="blank"></div>
							<input type="text" name="huikuantime" class="huikuantime" placeholder="{:lang('huikuan_time_now')}">
							<div class="blank"></div>
							<div style="border: 1px dashed #ccc;">
								<input type="file" id="pingzheng1">
							</div>
							<div class="blank"></div>
							<textarea name="remark" placeholder="{:lang('remark')}" style="width: 96%;padding: 2%;"></textarea>
							<div class="blank"></div>
							<div style="">
								<input type="hidden" name="pic" value="" id="img_src1">
								<input type="hidden" name="yinhangid" value="{$v.id}">
								<button type="button" class="btnqx">{:lang('cancel')}</button>
								<button type="submit" class="btnqd">{:lang('confirm_remittance')}</button>
							</div>
						</form>
					</div>
				</li>
				<li class="newadd" style="cursor: pointer;">
					<span style="display:block;border-bottom: 1px solid #dfdfdf;padding-bottom:5px; ">支付宝转账充值</span>
					<div style="line-height: 25px;padding: 10px 0;">支付宝：lidajp@outlook.com</div>
					收款人：刘延军&nbsp;&nbsp;<br><br> <br>
					<div style="text-align: center"><!--<a href="javascript:;" class="user-btn address-edit">填充值单</a>-->
<!--
						<a href="javascript:;" class="">填充值单</a></div>
-->
					<div class="address-form">
						<form class="chongzform" method="post" action="{:url('')}">
							<input type="text" name="yhname" value="" placeholder="付款帐号">
							<div class="blank"></div>
							<input type="text" name="zhname" value=""  placeholder="付款人姓名">
							<div class="blank"></div>
							<input type="text" name="zhanghao" value="" placeholder="交易流水号">
							<div class="blank"></div>
							<input type="text" name="amount" value="" placeholder="充值金额(人民币)">
							<div class="blank"></div>
							<input type="text" name="huikuantime" class="huikuantime" placeholder="{:lang('huikuan_time_now')}">
							<div class="blank"></div>
							<div style="border: 1px dashed #ccc;">
								<input type="file" id="pingzheng2">
							</div>
							<div class="blank"></div>
							<textarea name="remark" placeholder="{:lang('remark')}" style="width: 96%;padding: 2%;"></textarea>
							<div class="blank"></div>
							<div style="">
								<input type="hidden" name="pic" value="" id="img_src2">
								<input type="hidden" name="yinhangid" value="{$v.id}">
								<button type="button" class="btnqx">{:lang('cancel')}</button>
								<button type="submit" class="btnqd">{:lang('confirm_remittance')}</button>
							</div>
						</form>
					</div>
				</li>

			</ul>
		</div>
		<div class="user_kx">
			<h3 class="user_kx_title">
				支付宝充值

			</h3>
			<table class="table table-striped table-bordered">
				<if condition="$huikuanlist">
				<tr>
					<th width="70">{:lang('bank_name')}</th>
					<th width="80">{:lang('account_name')}</th>
					<th width="40">{:lang('account_num')}</th>
					<th width="75">{:lang('amount')}({:config('MAIN_COIN')})</th>
					<th width="80">{:lang('remark')}</th>
					<th width="85">{:lang('huikuan_time')}</th>
					<!-- <th>添加时间</th> -->
					<th width="70">{:lang('status')}</th>
				</tr>
				<volist name="huikuanlist" id="v">
					<tr>
						<td>{$v.yhname}</td>
						<td>{$v.zhname}</td>
						<td>{$v.zhanghao}</td>
						<td>{$v.amount}</td>
						<td>{$v.remark}</td>
						<td>{$v.huikuantime|date="Y-m-d",###}</td>
						<!-- <td>{$v.addtime|date="Y-m-d",###}</td> -->
						<td><eq name="v.status" value="0">{:lang('confirmation')}</eq><eq name="v.status" value="1">{:lang('has_recharge')}</eq><eq name="v.status" value="2">{:lang('not_daozhang')}</eq>&nbsp;<neq name="v.pic" value=""><a href="__ROOT__{$v.pic}" target="_blank">{:lang('vouchers')}</a></neq></td>
					</tr>
				</volist>
				<else />
				<td colspan="7">
				     <span style="color:#999;">{:lang('no_chongzhiinfo')}</span></td>
				</if>
				</tbody>


			</table>

			<div class="page">{$_page}</div>
		</div>

	</div>
	<link rel="stylesheet" href="__STATIC__/jquery-ui-1.11.4/jquery-ui.css">
	<script type="text/javascript" src="__STATIC__/jquery-ui-1.11.4/jquery-ui.js"></script>


	<script type="text/javascript">
		function fillNumOnly(obj) {
			var str = obj.value;
			if (str.trim == "")
				return;
			if (/[^0-9]/g.test(str)) {
				obj.value = str.substr(0, str.length - 1);
			}
		}
	</script>
	<script type="text/javascript">
		$(function(){
			var inputje=$('#chongzhiamount').val();
			var huilv={:config('MAIN_USD_HUILV')};
			inputje=parseFloat(inputje)*huilv;

			//var loadamount=(parseFloat(inputje)+0.3);
			//loadamount=loadamount/0.966;
			//loadamount=loadamount.toFixed(2);
			$('#paypalviewamount').html(inputje);
			$('#paypalsubmit').attr('href','{:url("Pay/paypal")}?price='+inputje);
			if (inputje==0) {
				$('#paypalviewamount').html('0.00');
				$('#paypalsubmit').attr('href','javascript:void(0);');
			};

			$('#paypalsubmit').click(function(){
				var amount=$('#chongzhiamount').val();
				if (isNaN(amount)||amount<=0) {
					alert('{:lang("no_amount")}');
					return false;
				}
			})
			$('#chongzhiamount').blur(function(){
				var jine=$(this).val();
				var huilv={:config('MAIN_USD_HUILV')};
				jine=parseFloat(jine)*huilv;
				if (jine==0) {
					$('#paypalviewamount').html('0.00');
					$('#paypalsubmit').attr('href','javascript:void(0);');
					return false;
				};
				//var amount=(parseFloat(jine)+0.3);
				//amount=amount/0.966;
				//amount=amount.toFixed(2);
				$('#paypalviewamount').html(jine);
				$('#paypalsubmit').attr('href','{:url("Pay/paypal")}?price='+jine);
			})
			$('.huikuantime').datepicker();
			$( ".huikuantime" ).datepicker( "option", "dateFormat", "yy-mm-dd");
			$('#newadd').click(function(){
				$(this).next().show();
			})
			$('.btnqx').click(function(){
				$(this).parents('.address-form').hide();
			})
			$('.address-edit').click(function(){
				$(this).parent().next().show();
			})
			$('.address-del').click(function(){
				var id=$(this).attr('did');
				$.post("{:url('User/addressdel')}",{'id':id},delsuccess);
				return false;
				function delsuccess(data){
					if (data.status) {
						$.thinkbox.success(data.info);
						setTimeout(jumpurl(data.url),1500);
					}else{
						$.thinkbox.error(data.info);
					};
				}
			})
			$("#pingzheng1").uploadify({
				'queueSizeLimit' : 1,
				'removeTimeout' : 0.5,
				'preventCaching' : true,
				'multi'    : false,
				'swf' 			: '__JS__/uploadify-v3.1/uploadify.swf',
				'uploader' 		: "{:url('User/uploadpingzheng',array('session_id'=>session_id()))}",
				'buttonText' 	: '<i class="userup-icon"></i>{:lang("up_vouchers")}',
				'width' 		: '258',
				'height' 		: '30',
				'fileTypeExts'	: '*.jpg; *.png; *.gif;',
				'onUploadSuccess' : function(file,data,response){
					/* var data = $.parseJSON(data);
					 if(data['status'] == 0){
					 $.thinkbox.error(data['info']);
					 return false;
					 }*/

					$('#img_src1').val(data);
					$('.uploadify-button-text').css('color','red').html('{:lang("up_success")}');
				}
			});
			$("#pingzheng2").uploadify({
				'queueSizeLimit' : 1,
				'removeTimeout' : 0.5,
				'preventCaching' : true,
				'multi'    : false,
				'swf' 			: '__JS__/uploadify-v3.1/uploadify.swf',
				'uploader' 		: "{:url('User/uploadpingzheng',array('session_id'=>session_id()))}",
				'buttonText' 	: '<i class="userup-icon"></i>{:lang("up_vouchers")}',
				'width' 		: '258',
				'height' 		: '30',
				'fileTypeExts'	: '*.jpg; *.png; *.gif;',
				'onUploadSuccess' : function(file,data,response){
					//var data = $.parseJSON(data);
					// if(data['status'] == 0){
					// 	$.thinkbox.error(data['info']);
					// 	return false;
					// }

					$('#img_src2').val(data);
					$('.uploadify-button-text').css('color','red').html('{:lang("up_success")}');
				}
			});
			$("#pingzheng3").uploadify({
				'queueSizeLimit' : 1,
				'removeTimeout' : 0.5,
				'preventCaching' : true,
				'multi'    : false,
				'swf' 			: '__JS__/uploadify-v3.1/uploadify.swf',
				'uploader' 		: "{:url('User/uploadpingzheng',array('session_id'=>session_id()))}",
				'buttonText' 	: '<i class="userup-icon"></i>{:lang("up_vouchers")}',
				'width' 		: '258',
				'height' 		: '30',
				'fileTypeExts'	: '*.jpg; *.png; *.gif;',
				'onUploadSuccess' : function(file,data,response){
					//var data = $.parseJSON(data);
					// if(data['status'] == 0){
					// 	$.thinkbox.error(data['info']);
					// 	return false;
					// }

					$('#img_src3').val(data);
					$('.uploadify-button-text').css('color','red').html('{:lang("up_success")}');
				}
			});
			$("#pingzheng4").uploadify({
				'queueSizeLimit' : 1,
				'removeTimeout' : 0.5,
				'preventCaching' : true,
				'multi'    : false,
				'swf' 			: '__JS__/uploadify-v3.1/uploadify.swf',
				'uploader' 		: "{:url('User/uploadpingzheng',array('session_id'=>session_id()))}",
				'buttonText' 	: '<i class="userup-icon"></i>{:lang("up_vouchers")}',
				'width' 		: '258',
				'height' 		: '30',
				'fileTypeExts'	: '*.jpg; *.png; *.gif;',
				'onUploadSuccess' : function(file,data,response){
					//var data = $.parseJSON(data);
					// if(data['status'] == 0){
					// 	$.thinkbox.error(data['info']);
					// 	return false;
					// }

					$('#img_src4').val(data);
					$('.uploadify-button-text').css('color','red').html('{:lang("up_success")}');
				}
			});
			$("#pingzheng5").uploadify({
				'queueSizeLimit' : 1,
				'removeTimeout' : 0.5,
				'preventCaching' : true,
				'multi'    : false,
				'swf' 			: '__JS__/uploadify-v3.1/uploadify.swf',
				'uploader' 		: "{:url('User/uploadpingzheng',array('session_id'=>session_id()))}",
				'buttonText' 	: '<i class="userup-icon"></i>{:lang("up_vouchers")}',
				'width' 		: '258',
				'height' 		: '30',
				'fileTypeExts'	: '*.jpg; *.png; *.gif;',
				'onUploadSuccess' : function(file,data,response){
					//var data = $.parseJSON(data);
					// if(data['status'] == 0){
					// 	$.thinkbox.error(data['info']);
					// 	return false;
					// }

					$('#img_src5').val(data);
					$('.uploadify-button-text').css('color','red').html('{:lang("up_success")}');
				}
			});
			$('form.chongzform').submit(function(){
				var self = $(this);
				$.post(self.attr("action"), self.serialize(), success, "json");
				return false;
				function success(data){
					if (data.status) {
						$.thinkbox.success(data.info);
						setTimeout(jumpurl(data.url),1500);
					}else{
						$.thinkbox.error(data.info);
					};
				}
			})
		})
	</script>
</block>